var localeKey = "locale";

function displayUserInfo(xmlData) {

	/* Get the user's data from the login response and display it */

	var loginId = $(xmlData).find("Responses > UserInfo > LoginId").text();
	var displayName = $(xmlData).find("Responses > UserInfo > DisplayName").text();
	var creationDate = $(xmlData).find("Responses > UserInfo > CreationDate").text();
	var userFor = $(xmlData).find("Responses> UserInfo > UserFor").text();
	var postCount = $(xmlData).find("Responses > UserInfo > PostCount").text();
	var locale = $(xmlData).find("Responses > UserInfo > Locale").text();

	localStorage.setItem(localeKey, locale);

	/* Set the culture based on your locale */
	Globalize.culture(locale);
	
	/* Display it */

	$("#loggedIn").html(loginId);
	$("#displayName").html(displayName);
	$("#userFor").html(userFor);

	var postCountInteger = parseInt(postCount);
	postCount = Globalize.format(postCountInteger, "n0");
	$("#postCount").html(postCount);

	var date = new Date();
	date.setISO(creationDate);
	creationDate = Globalize.format(date, "MMMM yyyy");
	$("#creationDate").html(creationDate);

	$("#loginSection").slideUp();
	$("#loggedInSection").slideDown();
}